# https://docs.openshift.com/container-platform/3.11/rest_api/oapi/v1.DeploymentConfig.html#object-schema
apiVersion: v1
kind: DeploymentConfig
metadata:
  name: frontend
  labels:
    service: frontend
spec:
  replicas: {{koschei_frontend_replicas}}
  selector:
    service: frontend
  strategy:
    type: Rolling
  template:
    metadata:
      labels:
        service: frontend
    spec:
      containers:
      - name: frontend
        image: image-registry.openshift-image-registry.svc:5000/koschei/koschei:latest
        command: [/usr/bin/koschei-frontend]
        ports:
        - containerPort: 8080
        volumeMounts:
        - name: config
          mountPath: /etc/koschei
          readOnly: true
        resources:
          requests:
            cpu: 500m
            memory: 128Mi
          limits:
            cpu: 2000m
            memory: 512Mi
        readinessProbe:
          timeoutSeconds: 1
          initialDelaySeconds: 5
          httpGet:
            path: /collections
            port: 8080
        livenessProbe:
          timeoutSeconds: 1
          initialDelaySeconds: 30
          httpGet:
            path: /collections
            port: 8080
      volumes:
      - name: config
        secret:
          secretName: frontend-config
  triggers:
  - type: ImageChange
    imageChangeParams:
      automatic: true
      from:
        kind: ImageStreamTag
        name: koschei:latest
      containerNames:
        - frontend
